package com.zenithmind.library.pojo.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

/**
 * 图书详情视图对象
 * 
 * @author ZenithMind
 * @since 2024-06-14
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Schema(name = "图书详情视图对象", description = "图书详细信息的视图对象")
public class BookDetailVO extends BookVO {

    @Schema(description = "分类信息")
    private CategoryVO category;

    @Schema(description = "出版社信息")
    private PublisherVO publisher;

    @Schema(description = "作者列表")
    private List<AuthorVO> authors;

    @Schema(description = "图书副本列表")
    private List<BookCopyVO> bookCopies;

    @Schema(description = "最新评价列表")
    private List<BookReviewVO> recentReviews;

    @Schema(description = "借阅统计信息")
    private BorrowStatisticsVO borrowStatistics;

    @Schema(description = "相关推荐图书")
    private List<BookVO> relatedBooks;

    /**
     * 分类视图对象
     */
    @Data
    @Schema(name = "分类视图对象")
    public static class CategoryVO {
        @Schema(description = "分类ID")
        private String id;
        
        @Schema(description = "分类名称")
        private String name;
        
        @Schema(description = "分类编码")
        private String code;
        
        @Schema(description = "分类描述")
        private String description;
        
        @Schema(description = "分类路径")
        private String path;
    }

    /**
     * 出版社视图对象
     */
    @Data
    @Schema(name = "出版社视图对象")
    public static class PublisherVO {
        @Schema(description = "出版社ID")
        private String id;
        
        @Schema(description = "出版社名称")
        private String name;
        
        @Schema(description = "出版社英文名")
        private String nameEn;
        
        @Schema(description = "所在国家")
        private String country;
        
        @Schema(description = "官方网站")
        private String website;
        
        @Schema(description = "出版社简介")
        private String description;
    }

    /**
     * 作者视图对象
     */
    @Data
    @Schema(name = "作者视图对象")
    public static class AuthorVO {
        @Schema(description = "作者ID")
        private String id;
        
        @Schema(description = "作者姓名")
        private String name;
        
        @Schema(description = "作者英文名")
        private String nameEn;
        
        @Schema(description = "笔名")
        private String penName;
        
        @Schema(description = "国籍")
        private String nationality;
        
        @Schema(description = "作者简介")
        private String biography;
        
        @Schema(description = "作者头像")
        private String avatar;
        
        @Schema(description = "作品数量")
        private Integer bookCount;
    }

    /**
     * 图书副本视图对象
     */
    @Data
    @Schema(name = "图书副本视图对象")
    public static class BookCopyVO {
        @Schema(description = "副本ID")
        private String id;
        
        @Schema(description = "条形码")
        private String barcode;
        
        @Schema(description = "RFID标签")
        private String rfidTag;
        
        @Schema(description = "状态")
        private Integer status;
        
        @Schema(description = "状态名称")
        private String statusName;
        
        @Schema(description = "位置信息")
        private String location;
        
        @Schema(description = "书架号")
        private String shelfNumber;
        
        @Schema(description = "当前借阅者ID")
        private String currentBorrowerId;
        
        @Schema(description = "当前借阅者姓名")
        private String currentBorrowerName;
        
        @Schema(description = "借阅次数")
        private Integer borrowCount;
        
        @Schema(description = "图书状况描述")
        private String condition;
    }

    /**
     * 图书评价视图对象
     */
    @Data
    @Schema(name = "图书评价视图对象")
    public static class BookReviewVO {
        @Schema(description = "评价ID")
        private String id;
        
        @Schema(description = "用户ID")
        private String userId;
        
        @Schema(description = "用户姓名")
        private String userName;
        
        @Schema(description = "评分")
        private Integer rating;
        
        @Schema(description = "评价内容")
        private String reviewContent;
        
        @Schema(description = "是否匿名")
        private Integer isAnonymous;
        
        @Schema(description = "点赞数")
        private Integer likeCount;
        
        @Schema(description = "评价时间")
        private String createTime;
    }
}
